//
//  ViewController1.m
//  blockChangeColor
//
//  Created by izhifei-Devon on 2017/6/7.
//  Copyright © 2017年 izhifei-Devon. All rights reserved.
//

#import "ViewController1.h"

@interface ViewController1 ()

@end

@implementation ViewController1

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    UIButton * button = [[UIButton alloc]initWithFrame:CGRectMake(100, 100, 80, 30)];
    [button setTitle:@"上一页" forState:UIControlStateNormal];
    [button setBackgroundColor:[UIColor blueColor]];
    
    [button addTarget:self action:@selector(backView) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)backView{
    [self.navigationController popViewControllerAnimated:YES];
    UIColor * color = [UIColor redColor];
    NSString * str = @"修改完毕";
    //3.用刚刚声明的Block去回调修改上一界面的背景色
    self.changeBackgroudColor(str,color);
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
